﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;

namespace Cos.Core.Security
{
    public static class HashHelper
    {
        public static string GetMD5Hash(string value)
        {
            using (var md5 = new MD5CryptoServiceProvider())
            {
                var passwordBytes = Encoding.UTF8.GetBytes(value);
                var hashBytes = md5.ComputeHash(passwordBytes);

                return BitConverter.ToString(hashBytes);
            }
        }
    }
}
